from fountion.allfountion import *
import openpyxl
import datetime
def message():
    min = int(input('请输入被测评者的数量：'))
    max = int(input('请输入测评者的数量：'))
    wb = openpyxl.Workbook()
    fun(min, max, wb)
    wb.save(r'C:\Users\Administrator\Desktop\文本\test_one.xlsx')
    wb.close()
    print('---------执行完成---------')
def fun(n, m,wb):
    sheet1 = wb.active
    sheet1.title = '人员信息'
    sheet1.append(['*被评估人邮箱', '*被评估人姓名', '*被评估人是否开通自评', '*评估人邮箱', '*评估人姓名', '*评估关系', '手机'])
    i = 0
    while i < n:
        name = c_name()
        e = email(name)
        p = generate_phone()
        d = datetime.datetime.now()
        a = 2
        sheet1.cell(row=a+(m+1)*i, column=1, value=e)
        sheet1.cell(row=a+(m+1)*i, column=2, value=name)
        sheet1.cell(row=a+(m+1)*i, column=3, value='是')
        sheet1.cell(row=a+(m+1)*i, column=4, value=e)
        sheet1.cell(row=a+(m+1)*i, column=5, value=name)
        sheet1.cell(row=a+(m+1)*i, column=6, value='自评')
        j = 0
        while j < m:
            b = j + 3
            sheet1.cell(row=b + (m+1) * i, column=1, value=e)
            sheet1.cell(row=b + (m+1) * i, column=2, value=name)
            sheet1.cell(row=b + (m+1) * i, column=3, value='是')
            name1 = c_name()
            e1 = email(name1)
            acc = assess()
            sheet1.cell(row=b + (m+1) * i, column=4, value=e1)
            sheet1.cell(row=b + (m+1) * i, column=5, value=name1)
            sheet1.cell(row=b + (m+1) * i, column=6, value=acc)
            sheet1.cell(row=b + (m + 1) * i, column=3, value='否')
            j += 1
        i += 1

if __name__ == '__main__':
    message()
